pkg_check_modules(sox IMPORTED_TARGET sox)
if(TARGET PkgConfig::sox)
    add_library(mltsox MODULE factory.c filter_sox.c)
    target_link_libraries(mltsox mlt m PkgConfig::sox)
    if(${sox_VERSION} GREATER 13)
        target_compile_definitions(mltsox PRIVATE SOX14)
    endif()
    set_target_properties(mltsox PROPERTIES LIBRARY_OUTPUT_DIRECTORY ..)
    install(TARGETS mltsox LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mlt)
    file(GLOB yml *.yml)
    install(FILES ${yml} DESTINATION ${CMAKE_INSTALL_DATADIR}/mlt/sox)
endif()
